import React, { JSX } from 'react'
import { UseCounter } from '@/lib/hooks/useCounter'
import { Dev } from '@/components/types'


const set: Set<Dev.VF> = new Set<Dev.VF>()

export function Cb (): JSX.Element {

    const { counter, increment, decrement } = UseCounter(100)

    function fn(){
        console.log('fn',counter)
        console.log(Math.random())
    }

    //const cacheFn: DEV.VF = React.useCallback(fn,[])
    set.add(increment)
    console.log('set: ', set.size)
    //set.forEach( fn)


    return (
        <div className={ 'p-20 bg-yellow-500' }>
            <p> Counter: { counter }</p>
            <button className={ 'py-3 px-5 bg-purple-500' }
                    onClick={ increment }>
                +1
            </button>
        </div>
    )
}
